package com.galaxy.coupon.domain.bo;

import com.galaxy.common.core.validate.AddGroup;
import com.galaxy.common.core.validate.EditGroup;
import com.galaxy.common.mybatis.core.domain.BaseEntity;
import com.galaxy.coupon.domain.UserCoupon;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.util.Date;

/**
 * 用户优惠券业务对象
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = UserCoupon.class)
public class UserCouponBo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @NotNull(message = "用户优惠券ID不能为空", groups = { EditGroup.class })
    private Long id;

    /** 用户ID */
    @NotNull(message = "用户ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long userId;

    /** 优惠券ID */
    @NotNull(message = "优惠券ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long couponId;

    /** 优惠券编码 */
    @NotBlank(message = "优惠券编码不能为空", groups = { AddGroup.class, EditGroup.class })
    @Size(min = 0, max = 64, message = "优惠券编码长度不能超过64个字符")
    private String couponCode;

    /** 状态(0:未使用,1:已使用,2:已过期) */
    private Integer status;

    /** 使用订单号 */
    @Size(min = 0, max = 32, message = "订单号长度不能超过32个字符")
    private String orderNo;

    /** 使用时间 */
    private Date useTime;

    /** 获取方式(0:系统发放,1:主动领取,2:积分兑换) */
    private Integer getType;

    /** 获取时间 */
    private Date getTime;

    /** 过期时间 */
    private Date expireTime;

    private Integer points;
}
